import Loging from '../Login.vue'
import Main from '../Main.vue'
import Util from "../util/Util"

let createInnerPath = function ()  {
  let views = Util.getViews();
  let childrenPath = new Array();
  for(let key in views){
    let value = views[key];
    let path = key.substring(2,key.length - 4);
    childrenPath.push({
      path,
      component:value
    });
  }
  return {
    path: '/view',
    component:Main,
    children:childrenPath
  }

}
export default {
  routes: [
    {
      path: '/login',
      name: 'app login',
      component: Loging
    },createInnerPath()
  ]
}
